local dashengshenwei = fk.CreateSkill{
    name = "ym2__dashengshenwei",
}
Fk:loadTranslationTable{
    ["ym2__dashengshenwei"] = "大圣神威",
    [":ym2__dashengshenwei"] = "一个有2~4张【闪】进入弃牌堆的回合结束时，你可以增加等量的攻击范围并视为对处于边缘的角色使用一张火【杀】。若放弃，则扣除此法获得的攻击范围并摸两张牌。",
    ["@ym2__dashengshenwei"] = "大圣神威",
    ["#ym2__dashengshenwei-use"] = "大圣神威：是否加 %arg 点攻击范围然后视为对 %arg2 使用一张火【杀】；或点“取消”摸两张牌",
    ["#ym2__dashengshenwei-invoke"] = "大圣神威：是否加 %arg 点攻击范围；或点“取消”摸两张牌",

    ["$ym2__dashengshenwei1"] = "尝尝这赛博金箍棒！",
    ["$ym2__dashengshenwei2"] = "好啊，打得好！",
}
dashengshenwei:addEffect(fk.TurnEnd,{
    mute = true,
    can_trigger = function (self, event, target, player, data)
        if player:hasSkill(dashengshenwei.name) then
            local room = player.room
            local ids = {}
            room.logic:getEventsOfScope(GameEvent.MoveCards, 1, function(e)
                for _, move in ipairs(e.data) do
                    if move.toArea == Card.DiscardPile then
                        for _, info in ipairs(move.moveInfo) do
                            if Fk:getCardById(info.cardId, true).trueName == "jink" then
                                table.insertIfNeed(ids, info.cardId)
                            end
                        end
                    end
                end
            end, Player.HistoryTurn)
            event:setCostData(self,{number = #ids})
            return #ids > 1 and #ids < 5
        end
    end,
    on_cost = function (self, event, target, player, data)
        local room = player.room
        local number = event:getCostData(self).number
        local tos = {}
        local card = Fk:cloneCard("fire__slash")
        for _, cp in ipairs(room.alive_players) do
            if player:distanceTo(cp) == (number + player:getAttackRange()) and not player:prohibitUse(card) and
            not player:isProhibited(cp,card) then
                table.insert(tos,cp)
            end
        end
        local prompt = "#ym2__dashengshenwei-use:::"..number..":"..table.concat(table.map(tos,function (element, index, array)
            return Fk:translate(element.general)
        end),"、")
        if #tos == 0 then
            prompt = "#ym2__dashengshenwei-invoke:::"..number
        end
        if room:askToSkillInvoke(player,{
            skill_name = dashengshenwei.name,
            prompt = prompt
        }) then
            event:setCostData(self,{number = number,tos = tos})
        end
        return true
    end,
    on_use = function (self, event, target, player, data)
        local room = player.room
        if event:getCostData(self).tos then
            room:notifySkillInvoked(player,dashengshenwei.name,"offensive")
            local number = event:getCostData(self).number
            local tos = event:getCostData(self).tos
            room:addPlayerMark(player,"@ym2__dashengshenwei",number)
            if #tos > 0 then
                room:useVirtualCard("fire__slash", nil, player, tos, dashengshenwei.name, true)
            end
        else
            room:notifySkillInvoked(player,dashengshenwei.name,"drawcard")
            room:setPlayerMark(player,"@ym2__dashengshenwei",0)
            player:drawCards(2,dashengshenwei.name)
        end
    end,
})
dashengshenwei:addEffect("atkrange", {
    correct_func = function(self, from, to)
        return from:getMark("@ym2__dashengshenwei")
    end,
})
return dashengshenwei